﻿/*
山形图 
Time Limit:1000MS  Memory Limit:32768K


Description:
输入中含有若干组数据，每组数都包含一个字符c和一个正整数n（n≤50），表示边长为n图案为c的山形字符图。
一个紧挨一个地打印所有这些山形字符图。 

Sample Input:
A 3
M 9
Sample Output:
  A
 AAA
AAAAA

        M
       MMM
      MMMMM
     MMMMMMM
    MMMMMMMMM
   MMMMMMMMMMM
  MMMMMMMMMMMMM
 MMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMM
*/
/*
//#include <stdio.h>
//#include <iostream.h>
//#include <iomanip.h>
//#include <stdlib.h>
//#include <string.h>
#include <iostream>
#include <iomanip>
#include <cstdlib>
#include <cstring>
using namespace std;
const unsigned MAX_SIZE=50U;

int main()
{
	char c;
	unsigned n;
	char line[MAX_SIZE+1];
//	while (EOF!=scanf("%c%u", &c, &n) && n)
	while (cin>>c>>n && n)
	{
		memset(line, 0, MAX_SIZE*sizeof(char));
		line[0]=c;
		for (unsigned i=0; i<n; )
		{				
			//printf("%*s\n", n+i, line);	
			cout<<setw(n+i)<<line<<"\n";
			++i;
			line[2*i]=line[2*i-1]=c;
		}
		cout<<endl;
	//	getchar();
	//	printf("\n");
	}
	return EXIT_SUCCESS;
}
*/
#include <iostream>
#include <iomanip>
#include <cstdlib>
#include <string>
using namespace std;
int main()
{
	char c;
	unsigned n;
	bool cr1=false;
	while (cin>>c>>n && n)
	{
		if(cr1)
			cout<<endl;
		bool cr2=false;
		for (unsigned i=0; i<n; ++i)
		{	
			if(cr2)
				cout<<endl;
			string line(2*i+1, c);
			cout<<setw(n+i)<<line;	
			cr2=true;
		}
		cr1=true;
	}
	return EXIT_SUCCESS;
}
